Developer Documentation

QuickTime 4 API Documentation

QuickTime 4 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Transfer Mode Matrices

QuickDraw GX provides three matrices in the transfer mode structure to give you great freedom in controlling, modifying, and combining source, destination, and result color components when performing a transfer mode operation.

The source matrix, device matrix, and result matrix provide a way of scaling, weighting, swapping, and averaging the components of a color space before or after the transfer mode operation. Each matrix is a 5 4 array that specifies the mixture of each of the (up to 4) components, plus an offset.

An identity matrix, one that has values of 1.0 along the diagonal and zero values elsewhere, has no effect. Here it is applied to a color in CMYK space:

The values for all color components after the matrix multiplication are the same as before. All transfer mode matrices in the default ink object are identity matrices.

The bottom row of the matrix specifies an offset value. The following matrix replaces c with 1/2 c + 1/2 m; it also scales k by 0.8 and adds 0.2 to it:

The source and device matrix are applied before the transfer mode calculation and after applying source minimum and source maximum. The result of the transfer mode calculation is run through the result matrix. The use of matrices allows you to apply sophisticated mapping operations--analogous to the scaling, rotation, translation, and distortion of shapes--to the colors involved in a transfer mode operation. Matrices are also used to create color separations, and to map source color ranges to spot colors.

Note
Although color components are described by unsigned short integers (16-bit positive numbers), the math internal to transfer modes is performed with long integers (32-bit signed numbers) to minimize overflow or roundoff error. As an example, elements in the source matrix could multiply by a large number, and elements in the result matrix could divide by a large number, without creating an overflow condition.


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |